<?php

function get_last_rank_daily_rise($order = 'ASC')
{/*{{{*/
    $rank_daily_rise = db_simple_query_first('rank_daily_rise', ['record_time <=' => datetime()], 'order by id desc');
    $last_record_time =  $rank_daily_rise['record_time'];

    if ($order === 'ASC') {
        $option_sql = 'order by rank_rise DESC';

        return db_simple_query('rank_daily_rise', ['record_time' => $last_record_time, 'rank_rise >' => 0], $option_sql);
    } else {
        $option_sql = 'order by rank_rise ASC';

        return db_simple_query('rank_daily_rise', ['record_time' => $last_record_time, 'rank_rise <' => 0], $option_sql);
    }
}/*}}}*/
